package cn.ronghuanet.org.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Department {

    @ApiModelProperty(value = "主键")
    private Long id;
    @ApiModelProperty(value = "名字")
    private String name;
    @ApiModelProperty(value = "描述")
    private String intro;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date updateTime;
    private Employee manager;   // 一个部门就一个管理员
    private Department parent;  // 一个子部门就一个父部门,所以是一个对象
    private String path;    // 部门层级的ID
    private Integer state;
    private List<Department> children;  // 子部门,一个部门下面应该有多个子部门
}
